function getQueryStringByName(name) {
  const result = location.search.match(new RegExp(`[\?\&]${name}=([^\&]+)`, 'i'))
                || location.hash.match(new RegExp(`[\?\&]${name}=([^\&]+)`, 'i'));
  if (result === null || result.length < 1) {
    return '';
  }
  return result[1];
}

export default {
  getQueryStringByName,
}
